<?=view('header.html')?>

<body class="layui-view-body">
    <div class="layui-content">
        <div class="layui-row">
            <div class="layui-card">
                <div class="layui-card-header">搜索参数</div>
                <div class="layui-card-body layui-form" id="search">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <div class="layui-form-mid">日期:</div>
                            <div class="layui-input-inline" style="width: 160px;">
                                <input type="text" name="time" id="time" value="<?=$time?>" autocomplete="off" class="layui-input">
                            </div>
                            <button class="layui-btn layui-btn-blue" lay-submit lay-filter="ams_search">查询</button>
                            <button class="layui-btn layui-btn-primary" lay-filter="ams_reset">重置</button>
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-card">
                <div class="layui-card-header">
                    错误日志
                </div>

                <div class="layui-card-body layui-text mokui-text">
                    <pre class="layui-code">
                        <?=$data?>
                    </pre>
                </div>
            </div>
        </div>
    </div>
    <?=view('footer.html')?>
    <script type="text/javascript">
        //JavaScript代码区域
        layui.use(['layer', 'table', 'code', 'form', 'jquery', 'laydate', 'element'], function () {
            var element = layui.element
                , $ = layui.jquery
                , table = layui.table
                , form = layui.form
                , layer = layui.layer
                , laydate = layui.laydate;
            


            layui.code({
                skin: 'notepad'
            });

            laydate.render({
                elem: '#time'
            });


            //头工具栏事件
            table.on('toolbar(listTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'delBatch':
                        var data = checkStatus.data;
                        layer.alert(JSON.stringify(data));
                        break;
                    case 'createBatch':
                        var data = checkStatus.data;
                        layer.msg('选中了：' + data.length + ' 个');
                        break;
                };
            });


            //搜索
            form.on('submit(ams_search)', function (data) {
                var field = data.field;
                location.href = adminpath + 'admin/admin/system/debug?time=' + field.time;
            });

            //搜索重置
            form.on('submit(ams_reset)', function (data) {
                $("#search")[0].reset();
                var field = data.field;
                $.each(field, function (k, v) {
                    field[k] = '';
                });
                tableInit.reload({
                    where: {
                        username: field.username
                        , day: field.day
                    }
                    , page: {
                        curr: 1
                    }
                });
            });


        });
    </script>
</body>

</html>
